﻿#If WINDOWS Then

Imports Microsoft.Xna.Framework
Imports Microsoft.Xna.Framework.Media
Imports Microsoft.Xna.Framework.Content
Imports Microsoft.Xna.Framework.Graphics
Imports Microsoft.Xna.Framework.Audio
Imports Runa.Resources.ResourceManager
Imports Runa.Foundation.Diagnostics

Namespace Global.Runa.Resources.ResourceManager

    Public Class VideoObject
        Inherits ResourceObjectBase

        Public Property IsLoop() As Boolean
        Public Property Volume() As Single
        Public Property Video() As Video

        Public Sub New()
            MyBase.New()
        End Sub

        Public Sub New(ByVal name As String, ByVal fileName As String)
            MyBase.New(name, fileName)
        End Sub

        Public Sub New(ByVal name As String, ByVal fileName As String, ByVal v As Video)
            MyBase.New(name, fileName)
            Me.Video = v
            Me.IsLoaded = True
        End Sub

        Public Sub New(ByVal name As String, ByVal fileName As String, ByVal game As Game)
            MyBase.New(name, fileName)
            Me.Load(game)
        End Sub

        Public Overrides Function Load(g As Microsoft.Xna.Framework.Game) As Boolean
            If Me.IsLoaded Then Return True
            Me.Video = g.Content.Load(Of Video)(Me.FileName)
            Me.IsLoaded = True
            Return True
        End Function

        Public Shared Function LoadFromStream(ByVal name As String, ByVal filename As String, ByVal stream As Stream) As VideoObject

        End Function

        Public Shared Function LoadFromData(ByVal name As String, ByVal filename As String, ByVal data() As Byte) As VideoObject
            Using ms As New MemoryStream(data)
                Return VideoObject.LoadFromStream(name, filename, ms)
            End Using
        End Function

    End Class

End Namespace

#End If